<template>
  <li>
    <span>
        {{ title }}
    </span>
    <div ref="editor" style="text-align: left; position: relative;z-index: 1"></div>
  </li>
</template>

<script>
import E from "wangeditor";
var editor;
export default {
  props: {
      title: {
          type: String
      },
      type: {
          type: String
      }
  },
  data() {
    return {
      Title: "",
      Content: "12",
    };
  },
    mounted() {
    editor = new E(this.$refs.editor);
    editor.config.onchange = (newHtml) => {
      this.$emit("SendEditer", {
          type: this.type,
          value: newHtml
      })
      this.Content = newHtml;
    };
    // 创建编辑器
    editor.create();
    this.editor = editor;
  },
};
</script>

<style scoped>
li span {
  display: inline-block;
  padding: 10px 0;
}
</style>